import {Roles} from './post-and-role.ts'

export interface SystemUserData {
  total: number
  buildingId: any | null
  rows: SystemUserDataRow[]
}

export enum Sex {
  Man = '0',
  Woman = '1',
  alien = '2',
}

export enum Role {
  Admin = 0,
  CommunityLeader = 5,
  Control = 4,
  BuildingAdmin = 3,
  ElderUser = 2,
  SuperAdmin = 1,
}

export interface SystemUserDataRow {
  managers?: number[]
  createBy: string
  createTime: string
  updateBy: string
  updateTime: string
  remark?: string
  userId: number
  deptId: number
  userName: string
  nickName: string
  email: string
  location: any
  buildingId: any | null
  floorId: any | null
  phonenumber: string
  contactPhonenumber: string
  contactName: string
  address: string
  idCard: string
  sex: string
  age?: number
  avatar: string
  password: string
  status: string
  delFlag: string
  loginIp: string
  loginDate: string
  dept: Dept
  roles: Roles[]
  roleIds: any
  postIds: number[]
  roleId: number
  admin: boolean
  roomName: string
  roomId: number
  rootId: string
  birth: string
  buildingName: string
}

export interface Dept {
  createBy: null
  createTime: null
  updateBy: null
  updateTime: null
  remark: null
  deptId: number
  parentId: null
  ancestors: null
  deptName: string
  orderNum: null
  leader: string
  phone: null
  email: null
  status: null
  delFlag: null
  parentName: null
  children: null[]
}

export interface SearchUserParams {
  userName?: string
  roles?: Roles[]
  roleIds?: number
  pageNum?: number
  pageSize?: number
  status?: string
  roleName?: string
  key?: string
}

export interface SystemUserParams {
  address?: string
  birth?: string
  buildingId?: number | null // null解绑楼栋
  checkOut?: boolean //true 长辈退房
  email?: string
  nickName?: string
  phonenumber?: string
  roleIds?: number[]
  sex?: string
  userName: string
  userId?: number
  roomId?: number
  floorId?: number
  roles?: Roles[]
  location: any
}
